package com.kehutong.common.dto;

import java.util.ArrayList;
import java.util.List;
import org.coraframework.util.Objects;
import com.kehutong.common.enums.MessageBusinessEnum;
import com.kehutong.common.enums.TemplateType;
import com.kehutong.common.util.TemplateReplaceUtil;

public class UniformSendReqDto {

    // 公用参数
    /**
     * 公司编号，必填
     */
    private String companyNo;

    /**
     * 聚合消息ID：对应具体的业务ID，从消息跳转具体业务时，能够根据msgId进行反查！！
     */
    private String msgId;

    /**
     * {@link MessageBusinessEnum} 业务类型，必填
     */
    private String businessTypeId;

    /**
     * {@link TemplateType} 模板类型，必填
     */
    private String templateTypeId;

    /**
     * <P>员工：false</p>
     * <P>业主（用户）：true</p>
     * <P>默认为员工</P>
     */
    private boolean userCreate;

    /**
     * 对应的id，必填
     */
    private String uuid;

    /**
     * 标题名称
     */
    private String title;

    // 站内信参数
    /**
     * 替换后的站内信模板内容，参考{@link TemplateReplaceUtil#replace(String, String, Object)}
     */
    private String innerData;

    // 应用消息参数
    /**
     * 替换后的应用消息模板内容，参考{@link TemplateReplaceUtil#replace(String, String, Object)}
     */
    private String appData;

    /**
     * 应用消息跳转地址
     */
    private String appToUrl;

    // 短信模板参数
    /**
     * 替换后的短信模板内容，参考{@link TemplateReplaceUtil#listTencentSmsParam(String, String, Object)}
     */
    private List<String> smsDataParams;

    /**
     * 待发送的手机号，如果需要短信发送，必填
     */
    private List<String> phoneList;

    // 微信消息参数
    /**
     * 替换后的公众号模板内容，暂时需要自行更改
     */
    private String wxChatData;

    /**
     * 公众号或小程序openId，可选
     */
    private String openId;

    /**
     * 小程序拼接路径的参数，可选
     */
    private String pageParam;

    public String getMsgId() {
        return msgId;
    }

    public void setMsgId(String msgId) {
        this.msgId = msgId;
    }

    public String getBusinessTypeId() {
        return businessTypeId;
    }

    public void setBusinessTypeId(String businessTypeId) {
        this.businessTypeId = businessTypeId;
    }

    public String getTemplateTypeId() {
        return templateTypeId;
    }

    public void setTemplateTypeId(String templateTypeId) {
        this.templateTypeId = templateTypeId;
    }

    public String getInnerData() {
        return innerData;
    }

    public void setInnerData(String innerData) {
        this.innerData = innerData;
    }

    public String getAppData() {
        return appData;
    }

    public void setAppData(String appData) {
        this.appData = appData;
    }

    public List<String> getSmsDataParams() {
        return smsDataParams;
    }

    public void setSmsDataParams(List<String> smsDataParams) {
        this.smsDataParams = smsDataParams;
    }

    public String getWxChatData() {
        return wxChatData;
    }

    public void setWxChatData(String wxChatData) {
        this.wxChatData = wxChatData;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getPageParam() {
        return pageParam;
    }

    public void setPageParam(String pageParam) {
        this.pageParam = pageParam;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public boolean isUserCreate() {
        return userCreate;
    }

    public void setUserCreate(boolean userCreate) {
        this.userCreate = userCreate;
    }

    public List<String> getPhoneList() {
        if (Objects.isEmpty(phoneList))
            return new ArrayList<>();

        return phoneList;
    }

    public void setPhoneList(List<String> phoneList) {
        this.phoneList = phoneList;
    }

    public String getCompanyNo() {
        return companyNo;
    }

    public void setCompanyNo(String companyNo) {
        this.companyNo = companyNo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAppToUrl() {
        return appToUrl;
    }

    public void setAppToUrl(String appToUrl) {
        this.appToUrl = appToUrl;
    }

    @Override
    public String toString() {
        return "UniformSendReqDto{" +
            "companyNo='" + companyNo + '\'' +
            ", msgId='" + msgId + '\'' +
            ", businessTypeId='" + businessTypeId + '\'' +
            ", templateTypeId='" + templateTypeId + '\'' +
            ", userCreate=" + userCreate +
            ", uuid='" + uuid + '\'' +
            ", title='" + title + '\'' +
            ", innerData='" + innerData + '\'' +
            ", appData='" + appData + '\'' +
            ", appToUrl='" + appToUrl + '\'' +
            ", smsDataParams=" + smsDataParams +
            ", phoneList=" + phoneList +
            ", wxChatData='" + wxChatData + '\'' +
            ", openId='" + openId + '\'' +
            ", pageParam='" + pageParam + '\'' +
            '}';
    }
}
